home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jurassic Jigsaws
/
JURASSIC.BIN
/
jigsaw.dir
/
00177_Script_Movie Script
< prev
next >
Wrap
Text File
|
1996-09-13
|
6KB
|
174 lines
Global gCurrentPuzzleNum, gLastPuzzleNum, gHowManyRight, gorigLoc, grightAnswerList, gMatchThese, gDragChannel, gOrigSprite, gFlag, gHintChannel, gFirstPieceChan, gLastPieceChan, gHintSprite, gFlyOffChannel, gCurrentModule, gPuzzleList, gHelpModule, gCurrentWIndow, void, filesep
On startMovie
if the machinetype = 256 then
set filesep = "\"
else
set filesep = ":"
end if
set gCurrentWIndow = void
set gHelpModule = #Jigsaw
-- repeat with x = 1 to 48
-- puppetSprite x, true
-- end repeat
set gFlyOffChannel = 45
set gDragChannel = 46
set gFirstPieceChan = 4
set gLastPieceChan = 15
set gHintChannel = 3
set gHintSprite = 18
set gLastPuzzleNum = 0
set gCurrentPuzzleNum = 1
set gMatchThese = [1,1,1,1,1,1,1,1,1,1,1,1]
set gPuzzleList = [1,2,3,4,5,6,7,8,9]
end startMovie
on stopmovielocal
end stopmovielocal
--------------------------------
on SetUpNextPuzzle
cursor 4
set the memberNum of sprite 1 = the number of member "background"
set the locH of sprite gDragChannel = 1500
set the locH of sprite gFlyOffChannel = 1500
set grightAnswerList = [0,0,0,0,0,0,0,0,0,0,0,0]
-- get a new random puzzle, not the same as the last one
if count(gPuzzleList) = 0 then set gPuzzleList = [1,2,3,4,5,6,7,8,9]
put random(count(gPuzzleList)) into tWhereInList
put getAt(gPuzzleList, tWhereInList) into gCurrentPuzzleNum
deleteAt (gPuzzleList, tWhereInList)
-- repeat while gCurrentPuzzleNum = gLastPuzzleNum
-- set gCurrentPuzzleNum = random (9)
-- end repeat
set gLastPuzzleNum = gCurrentPuzzleNum
set the memberNum of sprite gHintChannel = member ("hint" && gCurrentPuzzleNum)
-- Find the right puzzle pieces and scatter them
repeat with x = gFirstPieceChan to gLastPieceChan
set the locH of sprite x = 300
set the locV of sprite x = 300
set nextPiece = (x - 3)
set the memberNum of sprite x = member (gCurrentPuzzleNum &":"& nextPiece)
put ((the height of sprite x) / 2) into AdjustVert
put ((the width of sprite x) / 2) into AdjustHorz
repeat while the locH of sprite x > (135 - AdjustHorz) and ¼
the locH of sprite x < (520 + AdjustHorz) and ¼
the locV of sprite x < (425 + AdjustVert)
set the locV of sprite x = random (480 - AdjustVert)
set the locH of sprite x = random (640 - adjustHorz)
end repeat
if the locV of sprite x < 140 then set the locV of sprite x = the locV of sprite x + 140
if the locH of sprite x < 30 then set the locH of sprite x = the locH of sprite x + 560
end repeat
puppetSound "splat"
cursor 0
updateStage
end SetUpNextPuzzle
--------------------------------
on checkLocation
set PieceNum = gOrigSprite - 3
-- if the puzzle piece is inside the correct rectangle
if inside ( (the loc of Sprite gDragChannel), (value(line PieceNum of field ("targetRects" & gCurrentPuzzleNum)))) then
-- if there's already a piece there, get it out of the way
-- check for each possible puzzle piece
repeat with x = 4 to 15
if sprite gDragChannel intersects x and getAt(grightAnswerList, (x-3)) = 0 then
if x = gorigSprite then nothing
else
set the memberNum of sprite gFlyOffChannel = ¼
the number of member (the memberNum of sprite x)
set the loc of sprite gFlyOffChannel = the loc of sprite x
set the locH of sprite x = 1500
updateStage
repeat with L = 20 down to 1
set the locH of sprite gFlyOffChannel = ¼
(the locH of sprite gFlyOffChannel) ¼
+ (580 - (the locH of Sprite gFlyOffChannel))/L
updatestage
end repeat
set the loc of sprite x = the loc of sprite gFlyOffChannel
set the locH of sprite gFlyOffChannel = 1500
-- set the locH of sprite gDragChannel = 1500
updateStage
end if
end if
end repeat
set the locH of sprite gDragChannel = 1500
set the loc of sprite gOrigSprite = value(line PieceNum of field ("targetPoints" & gCurrentPuzzleNum))
-- change the list of rightAnswers to reflect that this position is properly placed
setAt (grightAnswerList, PieceNum, 1)
-- do colorchange and sound
updateStage
DoItsAMatch
else
-- check to see if the piece if behind the hint image
-- if sprite gDragChannel intersects 16 then
-- --alert "you have put a piece behind the hint image you will never see it again! Ha ha ha!!"
-- repeat while sprite gDragChannel intersects 16
-- put the locH of sprite gDragChannel into spritelocH
-- set the locH of sprite gDragChannel = spritelocH + 10
-- updatestage
-- end repeat
-- end if
-- in case the user moves a correct piece out of its spot, reset the answerList
setAt (grightAnswerList, PieceNum, 0)
end if
-- if they're all right
if grightAnswerList = gMatchThese then
repeat while soundbusy (1) or soundbusy (2)
nothing
end repeat
DoHappyRightThing
end if
updateStage
end checkLocation
--------------------------------
On DoItsAMatch
set the foreColor of Sprite gOrigSprite to 175
puppetSound "crunch"
updateStage
StartTimer
repeat while the timer < 20
nothing
end repeat
set the foreColor of sprite gOrigSprite to 255
updateStage
end DoItsAMatch
--------------------------------
On DoHappyRightThing
repeat with x = 2 to 48
puppetSprite x, false
end repeat
set the memberNum of sprite 1 = the number of member ("fullscreen" && gcurrentPuzzleNum)
puppetSound 7, member 295
--updateStage
puppetSound "magical"
--updateStage
set randomSound to (296 + random(4))
puppetSound 8, member randomSound
go "fullscreen"
end DoHappyRightThing
on killsounds
sound close 1
sound close 2
when mousedown then nothing
end killsounds
on playsoundeffect whatfolder, whatsound
sound playfile 1, the pathname & whatfolder & filesep & whatsound
end playsoundeffect
on playvoiceover whatfolder, whatsound
sound playfile 2, the pathname & whatfolder & filesep & whatsound
end playvoiceover